import Vue from "vue";
import VueRouter from "vue-router";
import Index from "../views/index.vue";
import Synthesis from "../views/synthesis.vue";
import Widedata from "../views/widedata.vue";
import Team from "../views/team.vue";
import Account from "../views/account.vue";
import Withdrawal from "../views/withdrawal.vue";
import List from "../views/list.vue";
import Swap from "../views/swap.vue";

import Wallet from "../views/wallet.vue";
import Language from "../views/language.vue";

Vue.use(VueRouter);

const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err);
};

const routes = [
  {
    path: "/",
    name: "Index",
    component: Index,
  },
  {
    path: "/synthesis",
    name: "Synthesis",
    component: Synthesis,
  },
  {
    path: "/widedata",
    name: "Widedata",
    component: Widedata,
  },
  {
    path: "/team",
    name: "Team",
    component: Team,
  },
  {
    path: "/account",
    name: "Account",
    component: Account,
  },
  {
    path: "/withdrawal",
    name: "Withdrawal",
    component: Withdrawal,
  },
  {
    path: "/list",
    name: "List",
    component: List,
  },
  {
    path: "/swap",
    name: "Swap",
    component: Swap,
  },

  {
    path: "/wallet",
    name: "Wallet",
    component: Wallet,
  },
  {
    path: "/language",
    name: "Language",
    component: Language,
  },
];

const router = new VueRouter({
  // mode: "history",
  routes,
});

export default router;
